﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics.Contracts;
using YasharEl.Infrastructure.Core.Users;
using YasharEl.Infrastructure.EntityModel;

namespace YasharEl.Infrastructure.Core.Commenting
{
    [ContractClass(typeof(CommentableContract))]
    public interface ICommentable
    {
        IComment AddComment(string comment);

        IList<IComment> Comments { get; set; }
    }

    [ContractClassFor(typeof(ICommentable))]
    internal abstract class CommentableContract : ICommentable
    {
        public IList<IComment> Comments
        {
            get
            {
                return new List<IComment>();
            }
            set
            {
            }
        }

        #region ICommentable Members

        public IComment AddComment(string comment)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
